//
//  ByDocumentaryFourValue.m
//  caipiao_ios
//
//  Created by mc on 2018/8/21.
//  Copyright © 2018年 ZhangZhanbin. All rights reserved.
//

#import "ByDocumentaryFourValue.h"

@implementation ByDocumentaryFourValue

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        CGFloat width = frame.size.width / 4;
       
        
        UILabel * valueLabel1 = [[UILabel alloc] init];
        [self addSubview:valueLabel1];
        [valueLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(0);
            make.width.mas_equalTo(width);
            make.bottom.equalTo(self).offset(0);
            make.top.equalTo(self).offset(0);
        }];
        valueLabel1.textColor = [UIColor grayColor];
        valueLabel1.font = FONT(12);
        valueLabel1.textAlignment = NSTextAlignmentCenter;
        valueLabel1.numberOfLines = 0;
        self.valueLabel1 = valueLabel1;
        
        UILabel * valueLabel2 = [[UILabel alloc] init];
        [self addSubview:valueLabel2];
        [valueLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(width);
            make.width.mas_equalTo(width);
            make.bottom.equalTo(self).offset(0);
            make.top.equalTo(self).offset(0);
        }];
        valueLabel2.textColor = [UIColor grayColor];
        valueLabel2.font = FONT(12);
        valueLabel2.textAlignment = NSTextAlignmentCenter;
        valueLabel2.numberOfLines = 0;
        self.valueLabel2 = valueLabel2;
        
        
        UILabel * valueLabel3 = [[UILabel alloc] init];
        [self addSubview:valueLabel3];
        [valueLabel3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(width * 2);
            make.width.mas_equalTo(width);
            make.bottom.equalTo(self).offset(0);
            make.top.equalTo(self).offset(0);
        }];
        valueLabel3.textColor = [UIColor grayColor];
        valueLabel3.font = FONT(12);
        valueLabel3.textAlignment = NSTextAlignmentCenter;
        valueLabel3.numberOfLines = 0;
        self.valueLabel3 = valueLabel3;
        
        UILabel * valueLabel4 = [[UILabel alloc] init];
        [self addSubview:valueLabel4];
        [valueLabel4 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(0);
            make.width.mas_equalTo(width);
            make.bottom.equalTo(self).offset(0);
            make.top.equalTo(self).offset(0);
        }];
        valueLabel4.textColor = [UIColor grayColor];
        valueLabel4.font = FONT(12);
        valueLabel4.textAlignment = NSTextAlignmentCenter;
        valueLabel4.numberOfLines = 0;
        self.valueLabel4 = valueLabel4;
        
        
        UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 1)];
        line.backgroundColor = BY_LINE_COLOR;
        [self addSubview:line];
        line.hidden = YES;
        self.line = line;
        
        UILabel *bottomLine = [[UILabel alloc] initWithFrame:CGRectMake(0, frame.size.height - 1, frame.size.width, 1)];
        bottomLine.backgroundColor = BY_LINE_COLOR;
        [self addSubview:bottomLine];
        bottomLine.hidden = YES;
        self.bottomLine = bottomLine;
    }
    return self;
}

@end
